#include <bits/stdc++.h>
using namespace std;

bool solve() {
    // READ
    long n, k;
    cin >> n >> k;
    long a[n];
    for (long& i : a)
        cin >> i;

    // INIT
    sort(a, a + n);
    long f[n], d[n];
    for (int i = 0; i < n; i++) {
        f[i] = abs(k - a[i]);
        if (f[i] == 0)
            return true;
    }

    for (int i = 0; i < n - 1; i++) {
        d[i] = a[i + 1] - a[i];
    }

    // SOLVE
}

int main() {
    int t;
    cin >> t;
    while (t-- > 0) {
        cout << (solve()) ? "YES" : "NO";
    }

    return 0;
}